package com.yalantis.ucrop.util;

public final class CubicEasing {

    public static float easeOut(float time, float start, float end, float duration) {
        return NumCalcUtil.add(NumCalcUtil.multiply(end , (NumCalcUtil.multiply((time = NumCalcUtil.subtract(time / duration , 1.0f))
                , NumCalcUtil.add(time * time , 1.0f)))) , start);
    }

    public static float easeInOut(float time, float start, float end, float duration) {
        return NumCalcUtil.add((time /= duration / 2.0f) < 1.0f ? end / 2.0f * time * time * time + start : end / 2.0f * ((time -= 2.0f) * time * time + 2.0f) , start);
    }

}
